{% extends "administrative/base.html" %}

{% block page_link %}
    <link rel="stylesheet" href="../../static/administrative/css/style.css">
{% endblock %}


{% block style %}
        <style>
        .add_class{
            background: #1E90FF;
        }
        tr{
            height: 35px;
        }
        th{
            text-align: center;
        }
        table {
            table-layout: fixed;
        }
        td:first-child, th:first-child {
            position:sticky;
            left:0; /* 首行永远固定在左侧 */
            z-index:1;
        }
        thead tr th {
            position:sticky;
            top:0; /* 列首永远固定在头部  */
            background-color: #E8E8E8;
        }
        th:first-child{
            z-index:2;
        }
        .model_li{
            color: #3f414d;
            width: 25%;
            cursor: pointer;
            display: none;
        }
        .add-station{
            width: 60%;height: 35px;background: #0070c1;border-color: #c5dbec;color: #ffffff;
        }
    </style>
{% endblock %}



{% block right_content %}
    <div class="headline">
        <div style="width: 15%;height: 100%;line-height: 40px;float: left;padding-left: 1%;">
            <a href="meeting_backlog.html" style="color: #0b0b0b;">
                <i class="iconfont icon-meeting-management-my-meeting"></i>
                <span> 我的待办</span>
            </a>
        </div>
    </div>



    <div class="right-box" style="width: 100%;height: 95%;">
        <div style="height: 88%;width: 100%;overflow: auto;">
            <table class="table table-hover table-bordered" style="border-collapse: collapse;width: 100%;">
                <thead>
                    <tr>
                        <th scope="col" style="width: 8%;">流程名称</th>
                        <th scope="col" style="width: 15%;">申请人</th>
                        <th scope="col" style="width: 15%;">申请部门</th>
                        <th scope="col" style="width: 15%;">申请时间</th>
                        <th scope="col" style="width: 8%;">流程状态</th>
                        <th scope="col" style="width: 8%;">当前节点</th>
                        <th scope="col" style="width: 20%;">操作</th>
                    </tr>
                </thead>
                <tbody style="overflow: auto;" id="t_table">
                </tbody>
            </table>
            <div id="img-display" style="width: 75%;text-align: center;position: fixed;display: none;">
                <div style="margin-top: 10%;">
                    <img src="../../static/public_file/images/page-img/11.jpg" alt="">
                    <p style="margin: 0;padding: 0;vertical-align: top;">暂无数据</p>
                </div>
            </div>
        </div>
        <div id="pagination" class="pagination" style="margin-left: 20px;margin-top: 1.5%;"></div>
    </div>
{% endblock %}

{% block script %}
    <script>
        window.onload = function () {
            document.getElementById("administrative").className = "add-nav-active";
            document.getElementById("my_meeting_to_do").className = "add_class";
            document.getElementById("meeting_management_ul").style.display = "inline-block";
            document.getElementById("jiantou2").className = "iconfont icon-jiantou-xia";
            document.getElementById("organizational_management_ul").style.display = "none";
        };

        var appliction_list = {{ appliction_list | safe }};
        if (appliction_list.length <= 0) {
            document.getElementById("img-display").style.display = "inline-block";
        }

        function click_ul() {
            if (document.getElementById("jiantou").className === "iconfont icon-jiantou-shang"){
                document.getElementById("jiantou").className = "iconfont icon-jiantou-xia";
                document.getElementById("organizational_management_ul").style.display = "inline-block";
            }else {
                document.getElementById("jiantou").className = "iconfont icon-jiantou-shang";
                document.getElementById("organizational_management_ul").style.display = "none";
            }
        }

        function click_ul1() {
            if (document.getElementById("jiantou1").className === "iconfont icon-jiantou-shang"){
                document.getElementById("jiantou1").className = "iconfont icon-jiantou-xia";
                document.getElementById("gebruikersrol_ul").style.display = "inline-block";
            }else {
                document.getElementById("jiantou1").className = "iconfont icon-jiantou-shang";
                document.getElementById("gebruikersrol_ul").style.display = "none";
            }
        }

        function click_ul2() {
            if (document.getElementById("jiantou2").className === "iconfont icon-jiantou-shang"){
                document.getElementById("jiantou2").className = "iconfont icon-jiantou-xia";
                document.getElementById("meeting_management_ul").style.display = "inline-block";
            }else {
                document.getElementById("jiantou2").className = "iconfont icon-jiantou-shang";
                document.getElementById("meeting_management_ul").style.display = "none";
            }
        }

        function click_ul3() {
            if (document.getElementById("jiantou3").className === "iconfont icon-jiantou-shang"){
                document.getElementById("jiantou3").className = "iconfont icon-jiantou-xia";
                document.getElementById("issue_approval_ul").style.display = "inline-block";
            }else {
                document.getElementById("jiantou3").className = "iconfont icon-jiantou-shang";
                document.getElementById("issue_approval_ul").style.display = "none";
            }
        }

        function click_ul_9() {
            if (document.getElementById("jiantou5").className === "iconfont icon-jiantou-shang"){
                document.getElementById("jiantou5").className = "iconfont icon-jiantou-xia";
                document.getElementById("dispatch-Administrator-1").style.display = "inline-block";
            }else {
                document.getElementById("jiantou5").className = "iconfont icon-jiantou-shang";
                document.getElementById("dispatch-Administrator-1").style.display = "none";
            }
        }

        function click_ul_10() {
            if (document.getElementById("jiantou4").className === "iconfont icon-jiantou-shang"){
                document.getElementById("jiantou4").className = "iconfont icon-jiantou-xia";
                document.getElementById("dispatch-Administrator").style.display = "inline-block";
            }else {
                document.getElementById("jiantou4").className = "iconfont icon-jiantou-shang";
                document.getElementById("dispatch-Administrator").style.display = "none";
            }
        }

        var t_table = document.getElementById("t_table");
        for (var i=0; i<appliction_list.length; i++){
            var tr = document.createElement("tr");
            var td=document.createElement("td");var td1=document.createElement("td");var td2=document.createElement("td");var td3=document.createElement("td");var td4=document.createElement("td");var td5=document.createElement("td");var td6=document.createElement("td");
            if (appliction_list[i]["status"] === "驳回"){
                tr.style.color = "red";
                td6.innerHTML="<a href='"+appliction_list[i]["apply_url"]+"&chongti=ture"+"' style='color: red;'>重提</a>";td6.style.textAlign="center";
            }else if (appliction_list[i]["status"] === "审批中"){
                tr.style.color = "green";
                td6.innerHTML="<a href='"+appliction_list[i]["apply_url"]+"'>审批</a>";td6.style.textAlign="center";
            }else {
                td6.innerHTML="<a href='"+appliction_list[i]["apply_url"]+"'>审批</a>";td6.style.textAlign="center";
            }
            td.innerHTML="会议室申请";td.style.textAlign="center";
            td1.innerHTML=appliction_list[i]["name"];td1.style.textAlign="center";
            td2.innerHTML=appliction_list[i]["department"];td2.style.textAlign="center";
            td3.innerHTML=appliction_list[i]["apply_time"];td3.style.textAlign="center";
            td4.innerHTML=appliction_list[i]["status"];td4.style.textAlign="center";
            td5.innerHTML=appliction_list[i]["present"];td5.style.textAlign="center";
            tr.appendChild(td);tr.appendChild(td1);tr.appendChild(td2);tr.appendChild(td3);tr.appendChild(td4);tr.appendChild(td5);tr.appendChild(td6);
            t_table.appendChild(tr);
        }
    </script>
{% endblock %}
